<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" DynamicMasterPageFile="~masterurl/default.master" Inherits="Ventigrate.Shared.ExternalMembership.WebControls.RolesDisp" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="~/_controltemplates/ToolBar.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="~/_controltemplates/ToolBarButton.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register Tagprefix="VSEMS" Namespace="Ventigrate.Shared.ExternalMembership.WebControls" Assembly="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral ID="PageTitle" Text="Manage external roles" EncodeMethod="HtmlEncode" runat="server"/>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
    <SharePoint:EncodedLiteral ID="TitleArea" Text="Manage external roles" EncodeMethod="HtmlEncode" runat="server"/>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderMain" runat="server">

    <wssuc:ToolBar id="onetidNavNodesTB" runat="server">
	    <Template_Buttons>
            <wssuc:ToolBarButton 
                runat="server"
	            Text="Display Users"
	            id="idUsersDisp"
	            ToolTip="Display Users"
	            NavigateUrl="UsersDisp.aspx"
	            ImageUrl="/_layouts/15/images/VSEMS/usersdisp.png"
	            AccessKey="U" />
            <wssuc:ToolBarButton 
                runat="server"
	            Text="New User"
	            id="idUserNew"
	            ToolTip="New User"
	            NavigateUrl="UserNew.aspx"
	            ImageUrl="/_layouts/15/images/VSEMS/usernew.png"
	            AccessKey="N"/>
            <wssuc:ToolBarButton 
                runat="server"
	            Text="Display Roles"
	            id="idRolesDisp"
	            ToolTip="Display Roles"
	            NavigateUrl="RolesDisp.aspx"
	            ImageUrl="/_layouts/15/images/VSEMS/rolesdisp.png"
	            AccessKey="R"/>
            <wssuc:ToolBarButton 
                runat="server"
	            Text="New Role"
	            id="idRoleNew"
	            ToolTip="New Role"
	            NavigateUrl="RoleNew.aspx"
	            ImageUrl="/_layouts/15/images/VSEMS/rolenew.png"
	            AccessKey="K"/>
        </Template_Buttons>
    </wssuc:ToolBar>
                
    <SharePoint:MenuTemplate ID="RoleMenu" runat="server">
        <SharePoint:MenuItemTemplate ID="DeleteRole" runat="server" Text="Delete" ImageUrl="/_layouts/15/images/delete.gif" ClientOnClickNavigateUrl="RoleDelete.aspx?Role=%ROLE%" Title="Delete"></SharePoint:MenuItemTemplate>
    </SharePoint:MenuTemplate>
    
    <VSEMS:FBADataSource runat="server" ID="RoleDataSource" ViewName="FBARolesView" />
            
    <SharePoint:SPGridView 
        ID="RoleGrid"
        runat="server"
        DataSourceID="RoleDataSource"
        AutoGenerateColumns="false"        
        AllowPaging="true"  
        PageSize="20"
        AllowSorting="true">
        
        <Columns>
            <SharePoint:SPMenuField  
                HeaderText="Role" 
                TextFields="Role"
                MenuTemplateId="RoleMenu"
                NavigateUrlFields="Role" 
                NavigateUrlFormat="RoleDelete.aspx?Role={0}" 
                TokenNameAndValueFields="ROLE=Role" 
                SortExpression="Role" />
             <SharePoint:SPBoundField 
                HeaderText="Users In Role"
                DataField="UsersInRole" 
                SortExpression="UsersInRole" />
        </Columns>
    </SharePoint:SPGridView>
    
    <SharePoint:SPGridViewPager ID="SPGridViewPagerRoleMenu" GridViewId="RoleGrid" runat="server" />
    
    <p>
        <asp:Label runat="server" ID="lblMessage" ForeColor="Red" />
    </p>
</asp:Content>
